UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dutA6X2DU4qQvpVX+XTvLD+1vJQ9pexc7zeqboUEvUc=' 
WHERE 
  key_id = 'afb9d133f58cef8f530b3696ea6b160bbdd19bf90ce454ba13a9c6eafbf1b8bc' 
  AND (
    token = 'dutA6X2DU4qQvpVX+XTvLD+1vJQ9pexc7zeqboUEvUc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023