UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cRac0AbNgZYwFSJpxYo9eY6WmwrzF1vofttWlFZAPzY=' 
WHERE 
  key_id = '6a2b63ed0c9ac9845ab315e0869520110d2666d9f8bdac3f04268a28e130e814' 
  AND (
    token = 'cRac0AbNgZYwFSJpxYo9eY6WmwrzF1vofttWlFZAPzY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040