UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2TmRaYzCyBfPO0O2GVImSMqubTaaCOyb32z++LMvj7o='
WHERE
key_id = 'bc15d0489a2b04c8c955b36caab4d7e1628e79c501513e1ca2be897627bda918'
AND (
token = '2TmRaYzCyBfPO0O2GVImSMqubTaaCOyb32z++LMvj7o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)