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