UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AMpCJU1RxLu1hdZtaIyqIQJMqTzvsSKZyDRZk7tRNCI='
WHERE
key_id = '084acb74f4ecb5957ddf581b66edadd5e4bda514bf89e579717b68c754c48b2f'
AND (
token = 'AMpCJU1RxLu1hdZtaIyqIQJMqTzvsSKZyDRZk7tRNCI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)