UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rJAXXkPsogVq5SjDehvi/pHhd3a9REeeb9jXNqPXdos=' 
WHERE 
  key_id = '6dfe9b97f9fe847b2a496fb55768fc1efd560944b516d352891f60c9585301e6' 
  AND (
    token = 'rJAXXkPsogVq5SjDehvi/pHhd3a9REeeb9jXNqPXdos=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030