UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hZG9+01i7woXzQGULkj9WejtT1Qdn7dCXIqnrc1sWYE='
WHERE
key_id = '7014f90591103fb015acd05b65cbfb6e128a6130b96b5974e89edd426096ac76'
AND (
token = 'hZG9+01i7woXzQGULkj9WejtT1Qdn7dCXIqnrc1sWYE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)