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