UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YHOi+yrZvJHVLkduXiA7UBk70idjPXdLi97opdygn0o=' 
WHERE 
  key_id = '0b0a95e2f482ec6b0255febfd94ff38d26cd17c72db9af46753d13570bc35ee1' 
  AND (
    token = 'YHOi+yrZvJHVLkduXiA7UBk70idjPXdLi97opdygn0o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036