UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yPLh5S/luaLAOhmUyv6ZN7MwQn2yQwpdPpJjvKhQ0Bg=' 
WHERE 
  key_id = 'e0957ac31982bf14d91e6fc3f4d20b15548887385d5211b5723f25f5b68963a4' 
  AND (
    token = 'yPLh5S/luaLAOhmUyv6ZN7MwQn2yQwpdPpJjvKhQ0Bg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047