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