UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wmKyPQWya6v8bE0Q+u/Yx1Kmma/Qyk7o3k7dtBTo8A0=' 
WHERE 
  key_id = '035893337c1cf14182a0212ae5f6e2a5c9362c44cc333abeb0419859a4109b41' 
  AND (
    token = 'wmKyPQWya6v8bE0Q+u/Yx1Kmma/Qyk7o3k7dtBTo8A0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032