UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '01jxBY77SKOPJiC8BWo1erx/a2hIWcJ+QoeO/9LrgeY=' 
WHERE 
  key_id = '340810cfc957f4d509b57d84e9b31c6dd775c788e37e1002e160b8f37211e735' 
  AND (
    token = '01jxBY77SKOPJiC8BWo1erx/a2hIWcJ+QoeO/9LrgeY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021