UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vqbnQFxmHzwjYs13A4bq7dR9G31eeih4ZL27AgWdBsY='
WHERE
key_id = 'e439aef21a2b31f483082cb10f2ceb4d80fb9a74fe0d38d8f006bf3580af10f3'
AND (
token = 'vqbnQFxmHzwjYs13A4bq7dR9G31eeih4ZL27AgWdBsY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)