UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1lRTpF/GFJhORVzrsnb5GaoOHVmG9KCVrEi+Es4U6mU='
WHERE
key_id = 'abca50978913174da2fc87035c5264c52e780e8a1c66152281a056c0bcf78dd2'
AND (
token = '1lRTpF/GFJhORVzrsnb5GaoOHVmG9KCVrEi+Es4U6mU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)