UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'J/b1Aw398emGcSRqb/XwhK446ffv8NngRQYYsC5kMbk='
WHERE
key_id = '5d050c000ef0f3ce42f0e6f5bf4204b19f32ec577017fbe08ced318c782632b8'
AND (
token = 'J/b1Aw398emGcSRqb/XwhK446ffv8NngRQYYsC5kMbk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)