UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+4i218wohXB2rhNjtfwReyzR4T7IpxaH1WdIy7nQARc='
WHERE
key_id = '7e32adc248c24d172d948730ae3b3fab11e7fb90d6de2a610507167aee593280'
AND (
token = '+4i218wohXB2rhNjtfwReyzR4T7IpxaH1WdIy7nQARc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)