UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1PQXpbCnQL+3JVKRl1wrQp5FPBNs73KRKsYdy5ymd34='
WHERE
key_id = 'cb7e028024dcc86372762cfaa412f0594f7fec72767b9d4f90bf3a51bf40ba4f'
AND (
token = '1PQXpbCnQL+3JVKRl1wrQp5FPBNs73KRKsYdy5ymd34='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)