UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3lehWdt4rfINDCqrqjbK19JJ725wU5SGxbQEbkWfA4w='
WHERE
key_id = '8073393430478c4444ae1db2861efb7dd6904000fc2aeeb9da6d74a4eccbfc4f'
AND (
token = '3lehWdt4rfINDCqrqjbK19JJ725wU5SGxbQEbkWfA4w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)