UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/D7RGyAV48AqhyNCsK6Uc3NKVS6MyCwXePwkP2ynx9s='
WHERE
key_id = '61bd2b752450b4d2e8928fbeb30cf479903cc117394cc88c1266f64d4b300407'
AND (
token = '/D7RGyAV48AqhyNCsK6Uc3NKVS6MyCwXePwkP2ynx9s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)