UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PofyHN4iRfLKyA9GgoX/murUb4AYD+8mIbPBFNfpmjA='
WHERE
key_id = '55a8f6e4c1dcd42b9858c18d7115f9290542c446e783420e6a712559ae0d62c1'
AND (
token = 'PofyHN4iRfLKyA9GgoX/murUb4AYD+8mIbPBFNfpmjA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)