UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hlaBjZMc/+Q4JuY9efd02WtmCkZci0rBWlCECS852KE='
WHERE
key_id = 'e2b08cdb2d987d411f88076ff3dad55494a7f7e509e167ff5af38a9267f49f0d'
AND (
token = 'hlaBjZMc/+Q4JuY9efd02WtmCkZci0rBWlCECS852KE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)