UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zuc2i4vNc/Pk0dpOm/JPCk4WgVVFeAPjpD+hZklPocU='
WHERE
key_id = 'c58e5dff65668591c150323aa0f99795783c8ad626ac35ad05d9952b4ad5a314'
AND (
token = 'Zuc2i4vNc/Pk0dpOm/JPCk4WgVVFeAPjpD+hZklPocU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)