UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Gfc0/1o7tg+58CjlQddFsIgNBGnoTwuFgrlGrDkUEnw=' 
WHERE 
  key_id = '905b80bb9ec83336317e56a9ba41a2a715c1bf66e6196c2fb19c89f31d6d4773' 
  AND (
    token = 'Gfc0/1o7tg+58CjlQddFsIgNBGnoTwuFgrlGrDkUEnw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017