UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gZ55n69DRq2xOwnq0mCBaiH054Wf1R8dL55PtpdUv9Y=' 
WHERE 
  key_id = '95f09c12b7148be893b1f7d95e77b89cb01e665c8ea415979256b56d5aaf4878' 
  AND (
    token = 'gZ55n69DRq2xOwnq0mCBaiH054Wf1R8dL55PtpdUv9Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027