UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cJPLxcOeifArWtcLga/EYLsWHWpKQFO0b9WQTseKAdw='
WHERE
key_id = 'fedfbaa4b451b69af945006011fcd03b257f8d5aaed05c81f4e75ac90305a680'
AND (
token = 'cJPLxcOeifArWtcLga/EYLsWHWpKQFO0b9WQTseKAdw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)