UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/Zz1e9VfkmU9STDCrkctSWIdPYG9Gj+kFwDyFjqOdok='
WHERE
key_id = '1d5d45fd1005b2b3dddd11f6d3367e1488fcdfb46014c23f0ae73a8f1e8a0bf7'
AND (
token = '/Zz1e9VfkmU9STDCrkctSWIdPYG9Gj+kFwDyFjqOdok='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)