UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bwDXsxuAVaHMMJcCpK72Z2JNByEKUEQp3jEn5CZQG30=' 
WHERE 
  key_id = 'cd234be475c549e7559ef042f7f23ea5887ad4b32c47fde42a645e8f3376e92f' 
  AND (
    token = 'bwDXsxuAVaHMMJcCpK72Z2JNByEKUEQp3jEn5CZQG30=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026