UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rB+8zmwAP/3fCe46DsIfiUju3g8yiOlmdW1LHIljEKM='
WHERE
key_id = 'f216ee0ae9842348c604e4b78dfdde9a56ff1673c1d9f18ad79f234e0447c1c7'
AND (
token = 'rB+8zmwAP/3fCe46DsIfiUju3g8yiOlmdW1LHIljEKM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)