UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EJIHEdwemS9rLG523FpKQpGXP2Ub0RENM42j4Wu7UoA='
WHERE
key_id = 'ea7fa0437ddba9f89d1c4eed4af63d116d445265b5f29ba0ca2cc67a9a4b8ba7'
AND (
token = 'EJIHEdwemS9rLG523FpKQpGXP2Ub0RENM42j4Wu7UoA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)