UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lu9AlyXPsfnoY/mYZwQNqZUebEBrgf37CSatLe/BM5U=' 
WHERE 
  key_id = 'c3b53156094cc45317cafb76111aa6fb3335e0fd5f4f74b8a8c32edb4acc884d' 
  AND (
    token = 'lu9AlyXPsfnoY/mYZwQNqZUebEBrgf37CSatLe/BM5U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031